t=[0:0.001:2*pi];
ft=t-1;
gt=(pi-1)-(pi+1)/pi*(sin(t)+1/2*sin(2*t)+1/3*sin(3*t));
plot(t,ft,t,gt)
xlabel('t')
legend('t-1','Third-order Fourier approximation')
